package jco3.core;

import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoFunctionTemplate;
import com.sap.conn.jco.JCoRepository;

public class SapHelper {
	
	public static JCoFunctionTemplate getRfcTemplate(String rfcName,JCoDestination destination) throws Exception{
		JCoRepository repository = destination.getRepository();
		JCoFunctionTemplate template = repository.getFunctionTemplate(rfcName);
		return template;
	}
	
	public static JCoFunction getRfcFunction(String rfcName,JCoDestination destination) throws Exception{
		JCoFunctionTemplate template = getRfcTemplate(rfcName, destination);
		return template.getFunction();
	}
}
